var params = {
	funcName:"query",
	queryId:"q_queue_monitor"
};
$.ajax({
	url: localStorage.server_ip+''+CONFIG_PARAMS.app_path+'/clientAdaptor',
  	dataType: 'xml',
  	data:params,
	success:function(msg){
		queueCreate_zhu(msg);
	}
});
function queueCreate_zhu(xml_data){
	var div = $("<div>").attr("id","queueZhu").addClass("graphCss");
	$("#queue_container").append(div).height($("#contentWarpper").height());
	var x_name=[];var data1=[];var data2=[];var data3=[];var data4=[];
	var ready_num;var wait_num;var phone_num;
	var size=$("#queue_container").parent().parent().data("highChartNum");
	  	$(xml_data).find("field").each(function(i){
	  		if(i==3)
				ready_num=$(this).get(0).attributes.getNamedItem("name").nodeValue;
			else if(i==4)
				wait_num=$(this).get(0).attributes.getNamedItem("name").nodeValue;
			else if(i==5)
				phone_num=$(this).get(0).attributes.getNamedItem("name").nodeValue;
	  	});
		$(xml_data).find("row").each(function(i){
			if(i+1>size && size!=0)
				return false;
			var col1 = $(this).get(0).attributes.getNamedItem("col2").nodeValue;//队列号
			var col3 = parseInt($(this).get(0).attributes.getNamedItem("col3").nodeValue);//登录数
			var col4 = parseInt($(this).get(0).attributes.getNamedItem("col4").nodeValue);//准备好
			var col5 = parseInt($(this).get(0).attributes.getNamedItem("col5").nodeValue);//等待数
			
			x_name.push(col1);
			data1.push(col4);
			data2.push(col5);
		});
		
        $('#queueZhu').highcharts({
            chart: {
                type: 'column',
                backgroundColor:CONFIG_PARAMS.GraphBackColor
            },
            title: {
                text: ''
            },
            subtitle: {
                text: ''
            },
            xAxis: {
                categories: x_name,
	            labels : { 
            		style:{
            			color:CONFIG_PARAMS.GraphFontColor
            		}
            	}
            },
            yAxis: {
                title: {
                    text: '数量',
                    style:{
	            		color:CONFIG_PARAMS.GraphFontColor
	            	}
                },
                labels : { 
            		style:{
            			color:CONFIG_PARAMS.GraphFontColor
            		}
            	},stackLabels: {
                    enabled: true,
                    style: {
                        fontWeight: 'bold',
                        color: (Highcharts.theme && Highcharts.theme.textColor) || CONFIG_PARAMS.GraphFontColor
                    }
                }
            },
            legend:{
	        	itemStyle: {
                	color: CONFIG_PARAMS.GraphFontColor
            	},
            	labels : { 
            		style:{
            			color:CONFIG_PARAMS.GraphFontColor
            		}
            	}
	        },
	         tooltip: {
                shared: true
            },
            plotOptions: {
                column: {
                    stacking: 'normal',
                    dataLabels: {
                        enabled: true,
                        color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || CONFIG_PARAMS.GraphFontColor,
                		formatter:function(){
                			return this.y || "";
                		}
                    }
                }
            },
            series: [{
                name: ready_num,
                data: data1,
                stack:'aa'
            }, {
                name: wait_num,
                data: data2,
                stack:'aa'
            }]
        });
}